<template>
  <div class="content-view-wrapper fullscreen">
    <div v-if="isLargeScreen"><RegisterWeb></RegisterWeb></div>
    <div v-else><RegisterMobile></RegisterMobile></div>
  </div>
</template>
<!--请车概览-->
<script>
import RegisterWeb from "./components/registerWeb.vue";
import RegisterMobile from './components/registerMobile.vue'
export default {
  name: "overviewRequest",
  components: { RegisterWeb,RegisterMobile },
  data() {
    return {
      breakPoint: 768,
      isLargeScreen: true
    };
  },
  computed: {
    // 计算属性，根据窗口宽度返回true或false
    // isLargeScreen() {
    //   return window.innerWidth >= this.breakPoint;
    // }
  },
  methods: {
    updateScreenSize() {
      this.isLargeScreen = window.screen.width >= this.breakPoint;
      console.log("this.isLargeScreen", this.isLargeScreen);
      console.log("window.innerWidth", window.screen.width);
      console.log("breakPoint", this.breakPoint);
    }
  },
  mounted() {
    this.updateScreenSize();
    // 监听窗口resize事件，以便在窗口大小改变时更新isLargeScreen的值
    window.addEventListener("resize", this.updateScreenSize);
  },
  beforeDestroy() {
    // 在组件销毁前移除事件监听器
    window.removeEventListener("resize", this.updateScreenSize);
  }
};
</script>
<style scoped lang="scss"></style>
